package com.freestyle.jmssample.api;

import org.springframework.amqp.core.*;
import org.springframework.lang.Nullable;

import java.util.Map;

/**
 * JMS工具定义类接口
 * Created by rocklee on 2022/1/6 15:14
 */
public interface JMSDeclare {
  DirectExchange newDirectExchange(String exChange);

  TopicExchange newTopicExchange(String exChange);

  FanoutExchange newFanoutExchange(String exChange);

  HeadersExchange newHeadersExchange(String exChange);

  Exchange initExchange(String exChange, String exchangeType, boolean isDurable, boolean isAutoDelete, Map<String, Object> arguments);

  Exchange declareExchange(Exchange exChange);

  boolean deleteExchange(String exChange);

  boolean isExChangeExists(String exChange);

  Queue initQueue(String queue, boolean isDurable, boolean isExclusive, boolean isAutoDelete, Map<String, Object> arguments);

  Queue initQueue(String queue, boolean... isDurable);

  boolean deleteQueue(String queue);

  boolean isQueueExists(String queue);

  int clearQueueData(String queue);
  void bindQueue(String queue, String exChange, String routKey,@Nullable Map<String, Object> arguments);
}
